package com.bo.rabbit.exception;

/**
 * @program rabbit
 * @Description 自定义异常
 * @Author Diviner
 * @Date 2024/03/26 10:37
 * @Version 1.0
 */
public class RabbitException extends RuntimeException{
    String errMessage;

    public RabbitException(String message) {
        super(message);
        this.errMessage = message;
    }

    public String getErrMessage() {
        return errMessage;
    }

    public void setErrMessage(String errMessage) {
        this.errMessage = errMessage;
    }
    public static void cast(CommonError error){
        throw new RabbitException(error.getErrMessage());
    }
}
